import  urllib.request
from idlelib import tree

url="https://www.baidu.com/"

headrs={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
}

request=urllib.request.Request(url=url,headers=headrs)
response=urllib.request.urlopen(request)
html=response.read().decode("utf-8")
from lxml import etree

etree_html = etree.HTML(html)
result=etree_html.xpath('//input[@name="rsv_t"]/@value')
print(result)
